package code.vo {

[Bindable]
public class OfferedTopic extends Topic {
	
	public var offeterdTopicId: int;
	public var userId: int;
	
	public function OfferedTopic(topicId: int, title: String, voteCnt: int, yetVoted: Boolean, offeterdTopicId: int, userId: int) {
		super(topicId, title, voteCnt, yetVoted);
		
		this.offeterdTopicId = offeterdTopicId;
		this.userId = userId;
	}


	public static function newByXml(otopic: Object): OfferedTopic {
		return new OfferedTopic(
			int(otopic.TopicId),
			String(otopic.Title),
			int(otopic.Vote.VoteCnt),
			int(otopic.Vote.YetVoted) == 1,
			int(otopic.OfferedTopicId),
			int(otopic.User.UserId)
		);
	}
	
}
}